class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  #skip CSRF on create.
  skip_before_filter :verify_authenticity_token

  def singularity
    p request.env["omniauth.auth"]
    user = User.from_omniauth(request.env["omniauth.auth"])
    if user.persisted?
      sign_in_and_redirect user, notice: 'success'
    else
      session["devise.user_attributes"] = user.attributes
      redirect_to '/'
    end
  end
end